<?php
// +----------------------------------------------------------------------
// | Fanwe 多语商城建站系统 (Build on ThinkPHP)
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://www.fanwe.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 云淡风轻(97139915@qq.com)
// +----------------------------------------------------------------------


// 文件上传
class FileUploadAction extends CommonAction{
	public function doUpload()
	{
		header("Content-Type:text/html; charset=utf-8");
		$result = $this->uploadFile(0,'kind',0,true);		
		$list = $result['uploadList'];
		if($result['status'])
		{
			$file_url = ".".$list[0]['recpath'].$list[0]['savename'];
			$html = '<html>';
			$html.= '<head>';
			$html.= '<title>Insert Image</title>';
			$html.= '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
			$html.= '</head>';
			$html.= '<body>';
			$html.= '<script type="text/javascript">';
			$html.= 'parent.parent.KE.plugin["image"].insert("' . $_POST['id'] . '", "' . $file_url . '","' . $_POST['imgTitle'] . '","' . $_POST['imgWidth'] . '","' . $_POST['imgHeight'] . '","' . $_POST['imgBorder'] . '","' . $_POST['align'] . '");';
			$html.= '</script>';
			$html.= '</body>';
			$html.= '</html>';
		echo $html;
		}
		else
		{
			echo "<script>alert('".$result['msg']."');</script>";
		}
	
	}
	public function file(){
		echo __FILE__;
	}
	
}
?>